//获取项目地址
function _getProjectUrl () {
    var url = window.location.href;
    var param1 = url.toString().indexOf('?');
    var param2 = url.toString().indexOf('#');
    if (param1 != -1 || param2 != -1) {
        if(param1 != -1 && param2 != -1){
            if(param1 > param2){
                url = url.toString().substr(0, param2);
            }else {
                url = url.toString().substr(0, param1);
            }
        }else if(param1 != -1){
            url = url.toString().substr(0, param1);
        }else{
            url = url.toString().substr(0, param2);
        }
        return url;
    }else {
        return url;
    }
};


//获取地址参数
function _getUrlParam (name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null)
        return unescape(r[2]);
    return null;
};


//转义字符转换
function _expString(s) {
    if(s){
        s = s.replace(/[\\\b\f\n\r\t]/g,''); //替换掉反斜杠的字符串
        // s = s.replace(/[\@\#\$\%\^\&\*\{\}\:\"\L\<\>\?]/g,'');
    }
    return s
}
